package com.ie.controller.before;

import com.ie.comment.http.ResponseResult;
import com.ie.comment.sercurity.anno.AuthIgrone;
import com.ie.entity.FocusEntity;
import com.ie.entity.GoodsEntity;
import com.ie.sevice.admin.GoodsService;
import com.ie.sevice.before.FocusService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @author hp
 */
@RestController
@RequestMapping("api/before/focus")
public class FocusController {
    @Autowired
    private FocusService focusService;

    @Autowired
    private GoodsService goodsService;

    @AuthIgrone
    @RequestMapping("add")
    public ResponseResult<Map<String , Object>> addFocus(@RequestBody FocusEntity focusEntity) {
         return focusService.addFocus(focusEntity);
    }

    @AuthIgrone
    @RequestMapping("get")
    public ResponseResult<Map<String , Object>> getMyFocusGoods(@RequestBody GoodsEntity goodsEntity) {
        return goodsService.iPageMyFocusGoods(goodsEntity);
    }
}
